package com.molichuxing.gateway.property;

/**
 * @Author: zhaopenghui
 * @Description: 车辆检验
 * @Date: Created in 15:47 2019/9/12
 * @Modified By:
 **/
public enum CarCheckInfoStatusEnum {

    /**
     * 全部
     */
    ALL(0, "全部"),
    /**
     * 待检验
     */
    NO_CHECK(1, "待检验"),

    /**
     * 待用户确认
     */
    WAIT_CONFIRM(2, "待用户确认"),

    /**
     * 待人工介入
     */
    WAIT_INTERVNTION(3, "待人工介入"),
    /**
     * 已检验
     */
    ALREADY_CHECK(4, "已检验");


    int value;
    String name;

    CarCheckInfoStatusEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }


    /**
     * 通过value获取枚举的name
     *
     * @param value
     * @return
     */
    public static String getName(int value) {
        com.molichuxing.services.property.CarCheckStatusEnum enumerate = getEnum(value);
        return enumerate == null ? null : enumerate.getName();
    }

    /**
     * 通过value获取枚举
     *
     * @param value
     * @return
     */
    public static com.molichuxing.services.property.CarCheckStatusEnum getEnum(int value) {
        for (com.molichuxing.services.property.CarCheckStatusEnum enumerate : com.molichuxing.services.property.CarCheckStatusEnum.values()) {
            if (enumerate.getValue() == value) {
                return enumerate;
            }
        }
        return null;
    }
}
